package com.tencent.qf.user.api;

import com.tencent.qf.user.api.dto.UserDTO;
import com.tencent.qf.user.convert.UserConvert;
import com.tencent.qf.user.dal.UserDO;
import com.tencent.qf.user.service.UserService;

import java.util.List;
import java.util.stream.Collectors;
import javax.annotation.Resource;

/**
 * Copyright (C) 2022 Limited, a Tencent company. All rights reserved.
 *
 * @author p_htaozhou@tencent.com
 * @create: 2022/9/8 10:00
 */
public class UserServiceApiImpl implements UserApi {
    @Resource
    UserService userService;

    @Override
    public List<UserDTO> queryAllUser() {
        List<UserDO> userDTOList = userService.queryAllUser();

        return userDTOList.stream().map(UserConvert.INSTANCE::userDOConvert2DTO).collect(Collectors.toList());
    }
}
